#ifndef __FUNC_CALLER_H__
#define __FUNC_CALLER_H__

class FuncCaller
{
	public:
		virtual void func_call(void* obj_ptr, void* param)=0;

};

template <typename T>
class FuncItem : public FuncCaller
{
	private:
		typedef void (T::*HandlerPtr)(void* param);
		HandlerPtr handler;

	public:
		void SetHandler(const HandlerPtr ptr) {
			handler = ptr;
		}
		void func_call(void* obj_ptr, void* param = NULL)
		{
			if( !obj_ptr )
				return ;

			(((T*)obj_ptr)->*handler)(param);
		}
		FuncItem(const HandlerPtr ptr):handler(ptr) {}  // 此处为新添加代码

};
#endif //__FUNC_CALLER_H__
